package com.lxit.video.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lxit.video.bean.VideoInfo;
import com.lxit.video.bean.VideoType;
import com.lxit.video.service.VideoInfoServiceYJ;
import com.lxit.video.service.VideoTypeServiceYJ;

@Controller
@RequestMapping("/videoInfoYJ")
public class VideoInfoControllerYJ {

	@Autowired
	private VideoInfoServiceYJ videoInfoServiceYJ;
	@Autowired
	private VideoTypeServiceYJ videoTypeServiceYJ;
	
	/**
	 * 查询视频index页面
	 */
	@RequestMapping("/selectVideoTypeVideoInfo")
	public String selectVideoTypeVideoInfo(Integer vTypeId,Map<String,Object> session) {
		//查询当前分类的最新视频
		List<VideoInfo> videoInfoTypeList = videoInfoServiceYJ.selectVideoTypeVideoInfo(vTypeId);
		session.put("videoInfoTypeList", videoInfoTypeList);
		//查询全部视频的最新视频
		List<VideoInfo> newVideoInfoList = videoInfoServiceYJ.selectNewVideoInfo();
		session.put("newVideoInfoList", newVideoInfoList);
		//查询全部视频分类
		List<VideoType> videoTypeList = videoTypeServiceYJ.selectVideoType();
		session.put("videoTypeList", videoTypeList);
		return "index";
	}
}